package com.shxy.rlzy.mapper;

import com.shxy.rlzy.entity.User;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import org.apache.ibatis.annotations.Select;
import org.springframework.stereotype.Repository;

import java.util.List;

/**
 * <p>
 *  Mapper 接口
 * </p>
 *
 * @author tanhao
 * @since 2021-08-16
 */
@Repository
public interface UserMapper extends BaseMapper<User> {

    /**
     * 查询指定角色的用户列表
     * @param roleId
     * @return
     */
    List<User> getUsersOfRole(Long roleId);

    /**
     * 根据账号查询用户信息
     * @param username
     * @return
     */
    @Select("SELECT * FROM sys_user WHERE username=#{username}")
    User getByUserName(String username);
}
